import request from '@/utils/request';
import IS_MOCK, { BASE_URL } from '@/utils/url';

//用户登录
export async function login(params) {
  return IS_MOCK
    ? //return true
    request('/api/user/login', {
      method: 'post',
      data: params,
    })
    : request(`${BASE_URL}/user/login`, {
      method: 'post',
      data: params,
    });
}
//退出登录
export async function loginOut(params) {
  return IS_MOCK
    ? //return true
    request('/api/user/loginOut', {
      method: 'get',
      params: { id: params },
    })
    : request(`${BASE_URL}/user/loginOut`, {
      method: 'get',
      params: { id: params },
    });
}
//获取当前用户
export async function queryCurrent() {
  return IS_MOCK
    ? //return true
    request('/api/user/currentUser')
    : request(`${BASE_URL}/user/currentUser`);
}

//全局字典
export async function getDict() {
  return;
  return IS_MOCK //return true
    ? request('/api/getDict')
    : request(`${BASE_URL}/api/getDict`);
}
